package cn.iocoder.yudao.module.brokerage.merchant.mq;

import cn.hutool.extra.spring.SpringUtil;
import cn.iocoder.yudao.module.api.brokerage.agency.message.BrokerageAgencyBindMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 招商分佣 Producer
 *
 * @author 山野羡民
 */
@Slf4j
@Component
public class BrokerageAgencyProducer {

    /**
     * 发送 {@link BrokerageAgencyBindMessage} 消息
     *
     * @param shopId 店铺编号
     * @param agencyUserId 招商人员用户编号
     */
    public void sendAgencyBindMessage(Long shopId, Long agencyUserId) {
        log.info("[sendAgencyBindMessage][shopId({}) agencyUserId({})]", shopId, agencyUserId);
        SpringUtil.getApplicationContext().publishEvent(new BrokerageAgencyBindMessage(shopId, agencyUserId));
    }

}
